home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_introcut.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  155 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_IntroCut.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     user0
  14.     message     entered
  15.     
  16.     thing       player      local
  17.     thing       car         local
  18.     
  19.     thing       cam1
  20.     thing       fadePlate
  21.     thing       minePlayer
  22.     thing       mineCar
  23.     thing       cam_Targ
  24.     thing       cam_Pos
  25.     
  26.     surface     trig1
  27.     surface     trig2
  28.     surface     stopface
  29.     
  30.     # ** pre-load door sounds **
  31.     sound       sndOpen=sol_cardoor_open_c.wav      local
  32.     sound       sndClose=sol_cardoor_close_c.wav    local
  33.     
  34.     cog         mineDoors
  35.     
  36.     int         done=0          local
  37.     int         mounted         local
  38. #    int         dontPlay=1      local
  39.  
  40.     int            bSeen=0            local
  41.     int         track_Open      local
  42.     int         track_Close     local
  43.     
  44. end
  45.  
  46. # ========================================================================================
  47.  
  48. code
  49.  
  50. startup:
  51.  
  52.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  53.  
  54.     Sleep(0.001); # Let engine get set up
  55.  
  56.     # Start on black...
  57.     SetCameraLookInterp(2, 0);
  58.     SetCameraPosInterp(2, 0);
  59.     SetCameraFocus(2, cam1);
  60.     SetCameraSecondaryFocus(2, cam_Targ);
  61.     SetCurrentCamera(2);
  62.     SetCameraFOV(75, 0, 0.0);
  63.  
  64.     return;
  65.  
  66. # ..............................................................................
  67.  
  68. user0: # RT: Indicates that autosave/restore has completed...
  69.  
  70.     if (bSeen) return; # RT
  71.     bSeen = 1;
  72.  
  73.     player = GetLocalPlayerThing();
  74.     
  75.     # Cut to cam1
  76.     SetCameraLookInterp(2, 0);
  77.     SetCameraPosInterp(2, 0);
  78.     SetCameraFocus(2, cam1);
  79.     SetCameraSecondaryFocus(2, cam_Targ);
  80.     SetCurrentCamera(2);
  81.     SetCameraFOV(75, 0, 0.0);
  82.     
  83.     # pre-load door sounds
  84.     track_Open = PlaySoundLocal(sndOpen, 0.0, 0.0, 0x0, 0);
  85.     track_Close = PlaySoundLocal(sndClose, 0.0, 0.0, 0x0, 0);
  86.     
  87.     Sleep(0.01);
  88.     
  89.     mounted = BoardVehicle(player);
  90.     #PrintInt(mounted);
  91.     
  92.     #SetCameraSecondaryFocus(2, minePlayer);
  93.     
  94.     # start cutscene and disable player
  95.     StartCutscene(2);
  96.     SetActorFlags(player, 0x200000);
  97.     
  98.     # fade in
  99.     ThingFadeAnim(fadePlate, 1, 0, 2.0, 0);
  100.     
  101.     Sleep(2.0);
  102.     
  103.     StopSound(track_Open, 0.0);
  104.     StopSound(track_Close, 0.0);
  105.     Sleep(0.1);
  106.     
  107.     # open mine doors
  108.     SendMessage(mineDoors, user0);
  109.     
  110.     #Sleep(0.5);
  111.     
  112.     # give minePlayer some thrust
  113.     SetThingThrust(minePlayer, '0.0 3.0 0.0');
  114.     
  115.     return;
  116.     
  117. # ========================================================================================
  118.  
  119. entered:
  120.  
  121.     car = GetSourceRef();
  122.  
  123.     if((BitTest(GetPhysicsFlags(car), 0x01000000)) && (done == 0))
  124.     {
  125.         if(GetSenderRef() == trig1)
  126.         {
  127.             # close mine doors
  128.             SendMessage(mineDoors, user1);
  129.         }
  130.         
  131.         if(GetSenderRef() == trig2)
  132.         {
  133.             # restore player controls
  134.             ClearActorFlags(player, 0x200000);
  135.             
  136.             # give camera to player
  137.             ResetCameraFOV(0, 0.0);
  138.             SetCameraPosition(1, GetThingPos(cam_Pos));
  139.             SetCurrentCamera(1);
  140.             
  141.             EndCutscene();
  142.             done = 1;
  143.             
  144.             # clear minecar flags
  145.             ClearSurfaceFlags(stopface, 0x4000);
  146.         }
  147.     }
  148.     
  149.     return;
  150.        
  151. # ========================================================================================
  152.  
  153. end
  154.  
  155.